import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: { title: '自述文件' },
            children:[
                {
                    path: '/dashboard',
                    component: resolve => require(['../components/page/Dashboard.vue'], resolve),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/combo',
                    component: resolve => require(['../components/page/Combo.vue'], resolve),
                    meta: { title: '套餐管理' }
                },

                {
                    path: '/staffsou',
                    component: resolve => require(['../components/page/staffsou.vue'], resolve),
                    meta: { title: '员工列表' }
                },
                {//美容统计
                    path: '/count',
                    component: resolve => require(['../components/page/count.vue'], resolve),
                    meta: { title: '美容统计' }
                },
                {
                    path: '/producttype',
                    component: resolve => require(['../components/page/product/producttype.vue'], resolve),
                    meta: { title: '产品分类' }
                },
                {
                    path: '/productlist',
                    component: resolve => require(['../components/page/product/productlist.vue'], resolve),
                    meta: { title: '产品列表' }
                },
                {
                    path: '/countlist',
                    component: resolve => require(['../components/page/product/countlist.vue'], resolve),
                    meta: { title: '库存报表' }
                },
                {
                    path: '/secKillPro',
                    component: resolve => require(['../components/page/product/secKillPro.vue'], resolve),
                    meta: { title: '秒杀商品列表' }
                },
                {
                    path: '/addType',
                    component: resolve => require(['../components/page/product/addType.vue'], resolve),
                    meta: { title: '新增类型' }
                },
                {
                    path: '/editProType',
                    component: resolve => require(['../components/page/product/editProType.vue'], resolve),
                    meta: { title: '编辑类型信息' }
                },
                {
                    path: '/addPro',
                    component: resolve => require(['../components/page/product/addPro.vue'], resolve),
                    meta: { title: '新增产品' }
                },
                {
                    path: '/editPro',
                    component: resolve => require(['../components/page/product/editPro.vue'], resolve),
                    meta: { title: '编辑产品信息' }
                },
                {
                    path: '/tree3',
                    component: resolve => require(['../components/page/tree3.vue'], resolve),
                    meta: { title: '消费列表' }
                },
                {
                    path: '/tree1',
                    component: resolve => require(['../components/page/tree1.vue'], resolve),
                    meta: { title: '用户列表' }
                },
                {
                    path: '/tree2',
                    component: resolve => require(['../components/page/tree2.vue'], resolve),
                    meta: { title: '会员列表' }
                }
                ,
                {
                    path: '/viewComeIn',
                    component: resolve => require(['../components/page/product/viewComeIn.vue'], resolve),
                    meta: { title: '进货记录' }
                },
                {
                    path: '/editKill',
                    component: resolve => require(['../components/page/product/editKill.vue'], resolve),
                    meta: { title: '编辑秒杀商品' }
                },
               
            ]
        },
        {
            path: '/login',
            component: resolve => require(['../components/page/Login.vue'], resolve)
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
})
